/**
 * 
 */
package com.roc.util.constant;

import org.apache.commons.lang3.StringUtils;

/**
 * @author RenPengFei
 * 2013-5-25 下午4:08:18
 */
public enum Role {
	SYSTEM("00","系统管理员"),
	MANAGER("01","管理员"),
	O_MANAGER("02","机构管理员"),
	AGENT("03","代理商"),
	MARKET_DIRECT("04","市场直营岗"),
	MARKET_LEAD("05","市场主管"),
	CLEAR_OPERATORS("06","清结算岗"),
	CLEAR_LEAD("07","清结算主管"),
	FINANCE_COMM("08","财务岗"),
	FINANCE_LEAD("09","财务主管"),
	OPERATORS_COMM("10","运营专员"),
	OPERATORS_LEAD("18","受理市场运营"),
	RISK_CONTROL_OPERATORS("12","风控操作员"),
	RISK_CONTROL_LEAD("13","风控主管"),
	WARE_HOUSE_LEAD("14","仓库"),
	MERCHANT("15","特约商户"),
	AGENT_BUSS("16","业务员"),
	SFB_AGENT("17","商服宝会员"),;
	

	
	private String code;
	private String name;
	
	private Role(String code,String name){
		this.code=code;
		this.name=name;
	}
	
	public static Role valueOfCode(String code) {
		if (StringUtils.isBlank(code)) {
			throw new IllegalArgumentException("Role Status " + code
					+ " is blank");
		}
		for (Role mt : values()) {
			if (mt.getCode().equals(code)) {
				return mt;
			}
		}
		throw new IllegalArgumentException("Role Type " + code
				+ " is not exist");
	}
	
	public String getCode() {
		return code;
	}

	public String getName() {
		return name;
	}
	
	 public static void main(String[] args) {
			System.out.println(Role.SYSTEM.getName());
		}
	
}
